#include "ff.h"
#include "kernel/astralapi.h"
#include "strapi.h"
#include "shell.h"

int pwd(int argc, char* argv[])
{
    char buffer[100];
    f_getcwd(buffer, 100);
    kprint("%s\n",buffer);
    return 0;
}

int ls(int argc, char* argv[])
{
    int scan_files(char *path);
    char buffer[100];
    f_getcwd(buffer, 100);
    scan_files(buffer);
    return 0;
}

void get_work_dir(char *buff)
{
    // *buff = '/';
    // *buff = '\0';
    f_getcwd(buff, 100);
}

int cd(int argc, char* argv[])
{
    char buffer[100];
    f_getcwd(buffer, 100);
    strncat(buffer,"/",100);
    strncat(buffer, argv[1], 100);
    f_chdir(buffer);
    return 0;
}

DEFINE_STATIC_CMD(ls, "list files or dir")
DEFINE_STATIC_CMD(cd, "change dir")
DEFINE_STATIC_CMD(pwd, "current work dir")